package com.solution.admin.customer.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.customer.dao.CustomerVisitLogDao;
import com.solution.admin.customer.entity.CustomerVisitLogEntity;
import com.solution.admin.customer.service.CustomerVisitLogService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 客户访问内容service实现层
 * @author lilp
 * @date 2018-07-07 09:26:31
 */
@Service
public class CustomerVisitLogServiceImpl extends BaseServiceImpl<CustomerVisitLogEntity> implements CustomerVisitLogService {

	/**
	 * 客户访问内容接口
	 */
	@Autowired
	private CustomerVisitLogDao customerVisitLogDao;

	protected BaseDao<CustomerVisitLogEntity> getDao() {
		return this.customerVisitLogDao;
	}

	/**
	 * 保存客户访问内容
	 * @param customerVisitLogEntity 客户访问内容实体
	 * @return Long 添加成功客户访问内容的ID
	 * @author lilp
	 * @date 2018-07-07 09:26:31
	 */
	public long saveCustomerVisitLog(CustomerVisitLogEntity customerVisitLogEntity) {
		return customerVisitLogDao.saveCustomerVisitLog(customerVisitLogEntity);
	}

	/**
	 * 分页查询客户访问内容
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author lilp
	 * @date 2018-07-07 09:26:31
	 */
	@Override
	public PageBean listCustomerVisitLogPage(PageParam pageParam, Map<String, Object> paramMap) {
		return customerVisitLogDao.listCustomerVisitLogPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return customerVisitLogEntity 用户对象
	 * @author lilp
	 * @date 2018-07-07 09:26:31
	 */
	public CustomerVisitLogEntity getCustomerVisitLogById(Long id) {
		return customerVisitLogDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param customerVisitLogEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author lilp
	 * @date 2018-07-07 09:26:31
	 */
	@Override
	public int updateCustomerVisitLog(CustomerVisitLogEntity customerVisitLogEntity) {
		return customerVisitLogDao.updateCustomerVisitLog(customerVisitLogEntity);
	}
	
	
	/**
	 * 根据条件查询客户访问内容
	 * @param param
	 * @return 数据列表
	 * @author lilp
	 * @date 2018-07-07 09:26:31
	 */
	@Override
	public List<CustomerVisitLogEntity> listCustomerVisitLog( Map<String, Object> param){
		return  customerVisitLogDao.listCustomerVisitLog(param);
	}
	
	/**
	 * 删除客户访问内容
	 * @param 
	 * @return int 返回删除记录条数
	 * @author lilp
	 * @date 2018-07-07 09:26:31
	 */
	public int deleteCustomerVisitLogById(long id){
		return  customerVisitLogDao.deleteById(id);
	}
	
}
